# -*- coding: utf8 -*-

_author_ = "boboxu"

if __name__=='__main__':
    '''
    添加工作路径
    引用自己写的模块
    '''
    import sys
    import os
    # 获取当前绝对路径
    curPath = os.path.abspath(os.path.dirname(__file__))
    rootPath = os.path.split(curPath)[0]+'\..'
    # 设置模块搜索路径为Root目录
    sys.path.append(rootPath)

# 自己的模块
from LQT.event_engine.event_engine_base import *
from LQT.event_engine.event_online import *
from LQT.constant import *

def run_online_engine(strategy):
    '''

    '''

    online_engine = EventEngineBase()
    event_online=EventOnline()
    event_online.event_data_dict["strategy_data"] = strategy
    online_engine.put(event_online)
    online_engine.register(EventType.EVENT_ONLINE.value, EventOnline.heart_breat)
    
    online_engine.start(timer=False)
    online_engine.stop()
